|
smartbuck8 2.2.0
|
API for configuring and manipulating Smart Buck 8 Click driver. More...
Topics | |
| Smart Buck 8 Registers List | |
| List of registers of Smart Buck 8 Click driver. | |
| Smart Buck 8 Registers Settings | |
| Settings for registers of Smart Buck 8 Click driver. | |
| Smart Buck 8 MikroBUS Map | |
| MikroBUS pin mapping of Smart Buck 8 Click driver. | |
Functions | |
| void | smartbuck8_cfg_setup (smartbuck8_cfg_t *cfg) |
| Smart Buck 8 configuration object setup function. | |
| err_t | smartbuck8_init (smartbuck8_t *ctx, smartbuck8_cfg_t *cfg) |
| Smart Buck 8 initialization function. | |
| err_t | smartbuck8_default_cfg (smartbuck8_t *ctx) |
| Smart Buck 8 default configuration function. | |
| err_t | smartbuck8_write_reg (smartbuck8_t *ctx, uint8_t reg, uint8_t data_in) |
| Smart Buck 8 write register function. | |
| err_t | smartbuck8_read_reg (smartbuck8_t *ctx, uint8_t reg, uint8_t *data_out) |
| Smart Buck 8 read register function. | |
| void | smartbuck8_enable_power (smartbuck8_t *ctx) |
| Smart Buck 8 enable power function. | |
| void | smartbuck8_disable_power (smartbuck8_t *ctx) |
| Smart Buck 8 disable power function. | |
| void | smartbuck8_enable_device (smartbuck8_t *ctx) |
| Smart Buck 8 enable device function. | |
| void | smartbuck8_disable_device (smartbuck8_t *ctx) |
| Smart Buck 8 disable device function. | |
| uint8_t | smartbuck8_get_pg_pin (smartbuck8_t *ctx) |
| Smart Buck 8 get power-good pin function. | |
| err_t | smartbuck8_read_status (smartbuck8_t *ctx, uint8_t *status) |
| Smart Buck 8 read status register function. | |
| err_t | smartbuck8_set_control (smartbuck8_t *ctx, uint8_t control) |
| Smart Buck 8 set control register function. | |
| err_t | smartbuck8_set_vout (smartbuck8_t *ctx, uint16_t vout_mv) |
| Smart Buck 8 set output voltage function. | |
API for configuring and manipulating Smart Buck 8 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| void smartbuck8_cfg_setup | ( | smartbuck8_cfg_t * | cfg | ) |
Smart Buck 8 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See smartbuck8_cfg_t object definition for detailed explanation. |
| err_t smartbuck8_default_cfg | ( | smartbuck8_t * | ctx | ) |
Smart Buck 8 default configuration function.
This function executes a default configuration of Smart Buck 8 Click board.
| [in] | ctx | : Click context object. See smartbuck8_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | void smartbuck8_disable_device | ( | smartbuck8_t * | ctx | ) |
Smart Buck 8 disable device function.
This function sets the EN pin to low logic level to disable the device.
| [in] | ctx | : Click context object. See smartbuck8_t object definition for detailed explanation. |
| void smartbuck8_disable_power | ( | smartbuck8_t * | ctx | ) |
Smart Buck 8 disable power function.
This function sets the PON pin to low logic level to disable the internal power supply.
| [in] | ctx | : Click context object. See smartbuck8_t object definition for detailed explanation. |
| void smartbuck8_enable_device | ( | smartbuck8_t * | ctx | ) |
Smart Buck 8 enable device function.
This function sets the EN pin to high logic level to enable the device.
| [in] | ctx | : Click context object. See smartbuck8_t object definition for detailed explanation. |
| void smartbuck8_enable_power | ( | smartbuck8_t * | ctx | ) |
Smart Buck 8 enable power function.
This function sets the PON pin to high logic level to enable the internal power supply.
| [in] | ctx | : Click context object. See smartbuck8_t object definition for detailed explanation. |
| uint8_t smartbuck8_get_pg_pin | ( | smartbuck8_t * | ctx | ) |
Smart Buck 8 get power-good pin function.
This function reads the logic level of the PG (power-good) pin.
| [in] | ctx | : Click context object. See smartbuck8_t object definition for detailed explanation. |
| err_t smartbuck8_init | ( | smartbuck8_t * | ctx, |
| smartbuck8_cfg_t * | cfg ) |
Smart Buck 8 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See smartbuck8_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See smartbuck8_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t smartbuck8_read_reg | ( | smartbuck8_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_out ) |
Smart Buck 8 read register function.
This function reads a single byte from one of the readable Smart Buck 8 registers. Allowed registers are VOUT, CONTROL, and STATUS.
| [in] | ctx | : Click context object. See smartbuck8_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [out] | data_out | : Pointer to memory where read data will be stored. |
0 - Success, -1 - Error. | err_t smartbuck8_read_status | ( | smartbuck8_t * | ctx, |
| uint8_t * | status ) |
Smart Buck 8 read status register function.
This function reads the value of the STATUS register and returns it via output pointer.
| [in] | ctx | : Click context object. See smartbuck8_t object definition for detailed explanation. |
| [out] | status | : Pointer to memory where status register value will be stored. |
0 - Success, -1 - Error. | err_t smartbuck8_set_control | ( | smartbuck8_t * | ctx, |
| uint8_t | control ) |
Smart Buck 8 set control register function.
This function writes a control byte to the CONTROL register.
| [in] | ctx | : Click context object. See smartbuck8_t object definition for detailed explanation. |
| [in] | control | : Control register byte. |
0 - Success, -1 - Error. | err_t smartbuck8_set_vout | ( | smartbuck8_t * | ctx, |
| uint16_t | vout_mv ) |
Smart Buck 8 set output voltage function.
This function sets the output voltage by writing a scaled value to the VOUT register. Voltage range is [SMARTBUCK8_VOUT_MV_MIN, SMARTBUCK8_VOUT_MV_MAX] in steps of 5 mV.
| [in] | ctx | : Click context object. See smartbuck8_t object definition for detailed explanation. |
| [in] | vout_mv | : Desired output voltage in millivolts. |
0 - Success, -1 - Error. | err_t smartbuck8_write_reg | ( | smartbuck8_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t | data_in ) |
Smart Buck 8 write register function.
This function writes a single byte to one of the writable Smart Buck 8 registers. Allowed registers are VOUT and CONTROL.
| [in] | ctx | : Click context object. See smartbuck8_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [in] | data_in | : Data byte to be written. |
0 - Success, -1 - Error.